<template>
	<view class="" style="padding: 0 20rpx;">
		<view class="list" v-for="item in list" @click="goto('/subPages/invoice/invoiceDetail?id='+item.id)">
			<view class="left">
				<view class="box">
					<view class="box_left">
						发票金额：
					</view>
					<view class="">
						{{item.price}}
					</view>
				</view>
				<view class="box">
					<view class="box_left">
						抬头类型：
					</view>
					<view class="">
						{{item.type ==1 ?'个人/非企业单位':'企业'}}
					</view>
				</view>
				<view class="box">
					<view class="box_left">
						申请时间：
					</view>
					<view class="">
						{{data(item.createtime)}}
					</view>
				</view>
			</view>
			<view class="right">
				{{item.status ==0?'已申请':'已处理'}} >
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: []
			};
		},
		async onLoad() {
			let res = await this.$api.getmyfp({})
			console.log(res);
			this.list = res.data.data
		},

		methods: {
			data(v) {
				console.log(v);
				let date = new Date(parseInt(v * 1000))
				console.log(date);
				// let date = new Date(parseInt(timestamp) * 1000)
				let Year = date.getFullYear()
				let Moth =
					date.getMonth() + 1 < 10 ?
					"0" + (date.getMonth() + 1) :
					date.getMonth() + 1
				let Day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate()
				let Hour = date.getHours() < 10 ? "0" + date.getHours() : date.getHours()
				let Minute =
					date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes()
				let Sechond =
					date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds()
				let GMT =
					Year +
					"-" +
					Moth +
					"-" +
					Day +
					"   " +
					Hour +
					":" +
					Minute +
					":" +
					Sechond
				return GMT
			},
			// 跳转
			goto(url) {
				uni.navigateTo({
					url,
				})
			}

		}
	}
</script>

<style lang="scss">
	.list {
		margin-top: 30rpx;
		padding: 30rpx 20rpx;
		background-color: #fff;
		border-radius: 13rpx;
		font-size: 24rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;

		.left {
			.box {
				display: flex;
				line-height: 50rpx;

				.box_left {
					color: #948e8e;
				}
			}
		}

		.right {
			color: #948e8e;
		}
	}
</style>